UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AKEbwpY/3d08c0MO46WPWcw7JTkRTSdg2XWiIZI81sg=' 
WHERE 
  key_id = '3a85240836172ac2ae1722c7873d6e143843d5375ef3fd5bdb63ddf5412c46f4' 
  AND (
    token = 'AKEbwpY/3d08c0MO46WPWcw7JTkRTSdg2XWiIZI81sg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016