UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FBgjJRItkSrHaO8BJiDgFGCb8QJMPFZA/RI7o2Hjt/s=' 
WHERE 
  key_id = 'be0eb15577494c667b2ec78b0917b7e73cbb6be1538c8ac05e34111ac9f0ae3a' 
  AND (
    token = 'FBgjJRItkSrHaO8BJiDgFGCb8QJMPFZA/RI7o2Hjt/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032