UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '14qn4kL97OB3BPTMt7yENMJmF9jf9rNiySCAybz6VoU=' 
WHERE 
  key_id = 'fc8bf3ec3127fb18c21a3a780ea666b9d93ede66e7be8b064a11b89dea29e6d7' 
  AND (
    token = '14qn4kL97OB3BPTMt7yENMJmF9jf9rNiySCAybz6VoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029