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

Query time 0.00030