UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l0WKsucQNOqtY40/Uc7k794+a4BCYiZ8KHaLa4gLqgQ=' 
WHERE 
  key_id = '4449c8d1d346484d792f37cf927392635f02e2349a70dcf53a67140c8e2991e6' 
  AND (
    token = 'l0WKsucQNOqtY40/Uc7k794+a4BCYiZ8KHaLa4gLqgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069