UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xNms77wwyfWrTBrHqCfnD4Qd4Rw4YAMDfz4jj+YOmtM=' 
WHERE 
  key_id = '7e96eeeda0a16c5a067b236d8404fca367bde7e35b04693682f062f2ff271a6e' 
  AND (
    token = 'xNms77wwyfWrTBrHqCfnD4Qd4Rw4YAMDfz4jj+YOmtM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051