UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MVl8/daJtDkKjYSJ34CSQtFEDu6yOuMMZrLSceme3g8=' 
WHERE 
  key_id = '0ea93eba64ae7f70687768447003cd423ac11737dc872384a7c4a2871cfbadf9' 
  AND (
    token = 'MVl8/daJtDkKjYSJ34CSQtFEDu6yOuMMZrLSceme3g8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018