UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iZ0o8o1w2TaM0hxokJg2FgBS7/rt5BCteFPfxuJmLqg=' 
WHERE 
  key_id = 'd610e0c2d1d85bd49b11e230dddec0da5c44c8fea345ae1d486078a0407979f2' 
  AND (
    token = 'iZ0o8o1w2TaM0hxokJg2FgBS7/rt5BCteFPfxuJmLqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024