UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZqbhLJWeuLVQjWvYDVajzjmJpB7KasWE6FeNPcNALTE=' 
WHERE 
  key_id = '648f154a1e817e3f7f1f92ba81bf0a762111e8c4e644470007949b761e098331' 
  AND (
    token = 'ZqbhLJWeuLVQjWvYDVajzjmJpB7KasWE6FeNPcNALTE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028