UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gXDTHFb4yq7vTRxyIUiPsZDDK+b1uIXYGpw0Nb7wSgE=' 
WHERE 
  key_id = 'efa068237b0442be3cf472b6b3555349f1bf81f1bbd13dfdf7c1f9433816d4d7' 
  AND (
    token = 'gXDTHFb4yq7vTRxyIUiPsZDDK+b1uIXYGpw0Nb7wSgE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025