UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vXxt7Gx5i6HGPWRHbsDA5szwltKXxbsLazs8f+ldd0A=' 
WHERE 
  key_id = '6809d284f4800abab434c1e3fa1d5b093555a0b0592158c334a74e64e9607c6a' 
  AND (
    token = 'vXxt7Gx5i6HGPWRHbsDA5szwltKXxbsLazs8f+ldd0A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042