UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vn/FiCCei68jAsWehPMiEJ0C1Wfs3baVaVKjWlsdvr8=' 
WHERE 
  key_id = '048f36352031dbb9c65c4c6004d6ee5bbc40d66d06caede1f55e0e52f6975f3d' 
  AND (
    token = 'Vn/FiCCei68jAsWehPMiEJ0C1Wfs3baVaVKjWlsdvr8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014