UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z3r5nJRgmDZ1hmvrZXtuUpE5R7QetoyigtUVschupuM=' 
WHERE 
  key_id = '1e1464b1e7f14ef44ab278698d2dc68a8e2ed216242b8c7fa95673e60e1ce5ea' 
  AND (
    token = 'z3r5nJRgmDZ1hmvrZXtuUpE5R7QetoyigtUVschupuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028