UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sCqstowMPUWX8NNPmnBXYLEcO/X/8gPoSmuNWhjt4aE=' 
WHERE 
  key_id = 'f0f03d0fe50e9a11a5f346e79bcf93eb3afe5e8e5fac9163cb8d13f39394bba2' 
  AND (
    token = 'sCqstowMPUWX8NNPmnBXYLEcO/X/8gPoSmuNWhjt4aE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029