UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OCXR1/4nJQlNjaosnqDD5N2ZQDz/Oly7QXv5y/o41xk=' 
WHERE 
  key_id = '979a1b5448307499620575c34f4832ac801b9ce79930153096f35e20fb7e47e8' 
  AND (
    token = 'OCXR1/4nJQlNjaosnqDD5N2ZQDz/Oly7QXv5y/o41xk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016