UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yHHpvhKAlad+fU3U/LgPRm6hWMZElZYl0qbAPNL0QFU='
WHERE
key_id = 'df74f9c22b3e910234c0e5f00dd0ed5d0f771305999f461ec4dded581a0bd6b7'
AND (
token = 'yHHpvhKAlad+fU3U/LgPRm6hWMZElZYl0qbAPNL0QFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)