UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RA32+9WJ94Yrubup6fRbGHhCVWuYVnbk3zFjsP03ju8=' 
WHERE 
  key_id = 'd5f3733551bce089f9206839ff5add6363fbcfc275b680618aa2a6e88fd94b56' 
  AND (
    token = 'RA32+9WJ94Yrubup6fRbGHhCVWuYVnbk3zFjsP03ju8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051