UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xJmUaVhKptwu3sjPaRdVsshWmZ0sJrAZlQ5ZlYRww8k='
WHERE
key_id = '7599f767990cfd9aaf7860bb35a84721e83f0fc02b0409f4a1ffd251701f4e2c'
AND (
token = 'xJmUaVhKptwu3sjPaRdVsshWmZ0sJrAZlQ5ZlYRww8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)