UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AE5Tb/6pd4YQb72fTliu1YPwwzB3jarDNbRhquUAcbQ=' 
WHERE 
  key_id = '891bb644b0ca95c7298a889f3d90da685b44572025ab5971a67e73b4d46802ad' 
  AND (
    token = 'AE5Tb/6pd4YQb72fTliu1YPwwzB3jarDNbRhquUAcbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048