UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ggi3v3nsNr/rfr4GKQnrO87AKkEN9NzW9Z2YbUMvhI4=' 
WHERE 
  key_id = 'f39190bbef382e4ea86fd621daad07abcc7997246efe618f145257c62d8d8ffb' 
  AND (
    token = 'Ggi3v3nsNr/rfr4GKQnrO87AKkEN9NzW9Z2YbUMvhI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031