UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NQR9qvU6Iqr7XbI+OTeKqALTd/UmjpTT4smD+ArpEhg='
WHERE
key_id = '03b703f2363b72992fc32c62bb67dde8ee7c46e557818b5fa5185c1afcc4ec74'
AND (
token = 'NQR9qvU6Iqr7XbI+OTeKqALTd/UmjpTT4smD+ArpEhg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)