UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XQvMNorNR3xZ+wXpsW4LhGwtTTmDzAsEhUe3VnRSCB0=' 
WHERE 
  key_id = 'faadfbdf2cab996a9cfc9c6ae5c1ab2ef16bbb7a147b464de6e4cad69de0f4bc' 
  AND (
    token = 'XQvMNorNR3xZ+wXpsW4LhGwtTTmDzAsEhUe3VnRSCB0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037