UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cXKi9U1oSTHiRB1EfAh/QvFIuWram5qHpDwyO5TLEXQ=' 
WHERE 
  key_id = '1d40a490b748a2b9ef23350236178bc258e00331b47186ee9d142cfb15cf9acf' 
  AND (
    token = 'cXKi9U1oSTHiRB1EfAh/QvFIuWram5qHpDwyO5TLEXQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048