UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mJUVOIAv1EJ0fNyDOMKUgkROL82JG9V0j0EDCMNMa5Y=' 
WHERE 
  key_id = 'b4167822ead3d9b11243510de9a41f099e7b27062a5feb9ee394a902b7e46cae' 
  AND (
    token = 'mJUVOIAv1EJ0fNyDOMKUgkROL82JG9V0j0EDCMNMa5Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021