UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UrQuXjcq1U6UpEhU4vX0Zqn0f9eupl7jEceOZCYb+E4=' 
WHERE 
  key_id = '63193f5144543e840f7ef95eba8dbc5de36b5fb2d202d8b9e156735fad11f84b' 
  AND (
    token = 'UrQuXjcq1U6UpEhU4vX0Zqn0f9eupl7jEceOZCYb+E4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032