UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1xR98bLN8EvmctD+vDT3E3p2Rgrn2ktj3JGoIdhuodM=' 
WHERE 
  key_id = '8c7eea8d14d73ee5e91fa0d18a1d0cd026e051bbc2136ff394ef706a3e917714' 
  AND (
    token = '1xR98bLN8EvmctD+vDT3E3p2Rgrn2ktj3JGoIdhuodM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053