UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VvQ0PI+Cdfx0dAhGB6yIPZnjKK+mrGkgQ4X1AeOgHqM='
WHERE
key_id = 'dd3426384e4b87cc8b5c9584b12baa47fd9a08996a1a9cdcfbb3d7f02eb5574f'
AND (
token = 'VvQ0PI+Cdfx0dAhGB6yIPZnjKK+mrGkgQ4X1AeOgHqM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)