UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7JNU6Pfgk4G1UivjWHXKKRoZSHytN0Pyf17FinAo7Xk=' 
WHERE 
  key_id = '127910be0be10a60dc11671d9f4d076824272f2eb638f88c92f63d364525d5cf' 
  AND (
    token = '7JNU6Pfgk4G1UivjWHXKKRoZSHytN0Pyf17FinAo7Xk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016