UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1XxMTMWhmGzuQqDExmzayL0YkV2iA7Kzvhy6/AAiV5w=' 
WHERE 
  key_id = '8638ce96702302fd5df5d1c2ac74743d4b0db06a47dd912990bdc60071f11669' 
  AND (
    token = '1XxMTMWhmGzuQqDExmzayL0YkV2iA7Kzvhy6/AAiV5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029