UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J6i0UTLTuPLzqc69pLGIRsKFXD20ReocCrwPzugp29E=' 
WHERE 
  key_id = '5ce4206aa5f4f9e1c802c1cc6f18f44b3357b0445e962b4bfa019a5064393319' 
  AND (
    token = 'J6i0UTLTuPLzqc69pLGIRsKFXD20ReocCrwPzugp29E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061