UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7sIIQn4De5/Dl4hlmVXWV+71gef3IAG5ZjD/6lxeqFg=' 
WHERE 
  key_id = 'ff945871e250eda1896251d5a86ec4f914b38af6f22a45d827d0b51855700943' 
  AND (
    token = '7sIIQn4De5/Dl4hlmVXWV+71gef3IAG5ZjD/6lxeqFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030