UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Z/PaLgKyc+BJXAWUdWxCFLxMqauS7RPxMHaxnKE15A=' 
WHERE 
  key_id = 'ec7073897a2ec69c976432163ce6ee8287d2cade2cd9fdabe061d53d57119972' 
  AND (
    token = '0Z/PaLgKyc+BJXAWUdWxCFLxMqauS7RPxMHaxnKE15A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034