UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mnYnU4bIexMxhILaBLfsEkV2CG3iSpDhDJ4OsLjAdro=' 
WHERE 
  key_id = 'eb525627b6fd8b1b95f5f05010b45d4c783a82589eb7c7b235ff8ad199cf88ac' 
  AND (
    token = 'mnYnU4bIexMxhILaBLfsEkV2CG3iSpDhDJ4OsLjAdro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032